Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Nov 30, 2025

Add ensure-compiled endpoint to edge worker control plane

This PR adds a new endpoint to the edge worker control plane API: /flows/:slug/ensure-compiled. This endpoint allows clients to verify that a flow's compiled SQL matches its expected shape, or to recompile it if needed.

Key features:

  • Adds authentication via an API key header
  • Supports both "development" and "production" modes:
    • Development mode automatically recompiles flows when changes are detected
    • Production mode returns a 409 error when changes are detected (preventing unexpected changes)
  • Returns detailed information about differences between the expected and actual flow shapes
  • Integrates with a database SQL function for persistence

The endpoint returns different status codes based on the result:

  • 200: Flow was verified, compiled, or recompiled successfully
  • 409: Flow shape mismatch detected in production mode
  • 400: Invalid request body
  • 401: Authentication failed
  • 404: Endpoint not configured
  • 500: Database error

Comprehensive tests have been added to verify all functionality and edge cases.

@changeset-bot
Copy link

changeset-bot bot commented Nov 30, 2025

⚠️ No Changeset found

Latest commit: 2268eec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor Author

jumski commented Nov 30, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge:queue - adds this PR to the back of the merge queue
  • hotfix:queue - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nx-cloud
Copy link

nx-cloud bot commented Nov 30, 2025

View your CI Pipeline Execution ↗ for commit 2268eec

Command Status Duration Result
nx run edge-worker:test:integration ✅ Succeeded 3m 36s View ↗
nx run edge-worker:e2e ✅ Succeeded 34s View ↗
nx run core:pgtap ✅ Succeeded <1s View ↗
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 4s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 26s View ↗
nx run cli:e2e ✅ Succeeded 3s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 2m 2s View ↗
nx run client:e2e ✅ Succeeded 1m 9s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-04 11:21:49 UTC

@jumski jumski force-pushed the 11-30-feat_edge-worker_add_ensure-compiled_endpoint_to_controlplane branch from 37bddc8 to 6ed062f Compare November 30, 2025 14:47
@jumski jumski force-pushed the 11-30-feat_core_add_ensure_flow_compiled_function branch from cbfdb88 to 4cd34c0 Compare November 30, 2025 14:47
@github-actions
Copy link
Contributor

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-467.pgflow.pages.dev

📝 Details:

  • Branch: 11-30-feat_edge-worker_add_ensure-compiled_endpoint_to_controlplane
  • Commit: c994ef3758fedc07e28325383adfe079979721e1
  • View Logs

_Last updated: _

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 4, 2025

Merge activity

# Add ensure-compiled endpoint to edge worker control plane

This PR adds a new endpoint to the edge worker control plane API: `/flows/:slug/ensure-compiled`. This endpoint allows clients to verify that a flow's compiled SQL matches its expected shape, or to recompile it if needed.

Key features:
- Adds authentication via an API key header
- Supports both "development" and "production" modes:
  - Development mode automatically recompiles flows when changes are detected
  - Production mode returns a 409 error when changes are detected (preventing unexpected changes)
- Returns detailed information about differences between the expected and actual flow shapes
- Integrates with a database SQL function for persistence

The endpoint returns different status codes based on the result:
- 200: Flow was verified, compiled, or recompiled successfully
- 409: Flow shape mismatch detected in production mode
- 400: Invalid request body
- 401: Authentication failed
- 404: Endpoint not configured
- 500: Database error

Comprehensive tests have been added to verify all functionality and edge cases.
@graphite-app graphite-app bot force-pushed the 11-30-feat_core_add_ensure_flow_compiled_function branch from fae2d4e to c7eb99e Compare December 4, 2025 11:11
@graphite-app graphite-app bot force-pushed the 11-30-feat_edge-worker_add_ensure-compiled_endpoint_to_controlplane branch from 5c1805a to 2268eec Compare December 4, 2025 11:11
@graphite-app graphite-app bot changed the base branch from 11-30-feat_core_add_ensure_flow_compiled_function to main December 4, 2025 11:23
@graphite-app graphite-app bot merged commit 2268eec into main Dec 4, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants